package com.itic.appbase.framework.type;

public enum DeliveryMethod {

    Delivery("delivery","配送发货"),Self("self","自由自提点"),QCode("qcode","二维码凭证"),VirtualCode("virtualCode","虚拟码");
    private String method;
    private String name;

    DeliveryMethod(String method, String name) {
        this.method = method;
        this.name = name;
    }

    public String getMethod() {
        return method;
    }

    public String getName() {
        return name;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static DeliveryMethod getDeliveryMethod(String method){
        DeliveryMethod DeliveryMethod = null;
        switch (method){
            case "delivery":
                DeliveryMethod = DeliveryMethod.Delivery;
                break;
            case "self":
                DeliveryMethod = DeliveryMethod.Self;
                break;
            case "qcode":
                DeliveryMethod = DeliveryMethod.QCode;
                break;
            case "virtualCode":
                DeliveryMethod = DeliveryMethod.VirtualCode;
                break;
        }
        return DeliveryMethod;
    }
}
